package jflowmap.model.ontology.calculation;


import java.util.Set;

import jflowmap.model.ontology.Context;
import jflowmap.model.ontology.Dimension;
import jflowmap.model.ontology.DimensionCollection;
import jflowmap.util.Pair;

import com.google.common.collect.Sets;


public class UnboundConstraint extends AbstractConstraint {

	DimensionCollection dimensionCollection;

	public UnboundConstraint(String constraintName, Context context, DimensionCollection collection) {
		super(constraintName, context);
		this.dimensionCollection = collection;
	}

	@Override
	public String toString() {
		return "UnboundConstraint [constraintName=" + getName()
				+ ", dimensionCollection=" + dimensionCollection + "]";
	}

	@Override
	public Set<Pair<String, Dimension>> getDimensions() {
		Set<Pair<String, Dimension>> result = Sets.newHashSet();
		for (Dimension dim: dimensionCollection.get()) {
			result.add(Pair.of(getName(), dim));
		}

		return result;
	}
}
